"""
Project Name : api_automation_framework
File Name : anything.py
Author : lldhsds
Date : 2024/12/29 16:04
Description: /anything/{anything} Return anything passed in request data.
"""

import requests

def anything_anything(method: str, anything: str) -> None:
    """
    /anything Return anything passed in request data.
    :param method: str
    :responses 200 	Anything passed in request
    """
    if method not in ["GET", "POST", "PUT", "DELETE", "PATCH"]:
        raise ValueError("Invalid method")
    url = f"https://httpbin.org/anything/{anything}"
    headers = {"Accept": "application/json"}
    response = requests.request(method, url, headers=headers)
    print(response.status_code)
    print(response.json())
    print(response.headers)

METHODS = ["GET", "POST", "PUT", "DELETE", "PATCH"]
for method in METHODS:
    anything_anything(method, "test123")
